package com.zqu.service.impl;

import com.zqu.mapper.ContactMapper;
import com.zqu.pojo.Contact;
import com.zqu.service.ContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContactServiceImpl implements ContactService {

    @Autowired(required = false)
    private ContactMapper contactMapper;

    @Override
    public Contact selectContactById(long id) {
        return contactMapper.selectTById(id);
    }

    @Override
    public List<Contact> selectList(Contact contact) {
        return contactMapper.selectList(contact);
    }

    @Override
    public boolean insertContact(Contact contact) {
        return contactMapper.insertT(contact)>0;
    }

    @Override
    public boolean updateContact(Contact contact) {
        return contactMapper.updateT(contact)>0;
    }

    @Override
    public boolean deleteContact(long id) {
        return contactMapper.deleteT(id)>0;
    }

    @Override
    public boolean deleteContactByIds(String[] ids) {
        return contactMapper.deleteTByIds(ids)>0;
    }
}
